import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      component: () => import('@/layouts/default.vue'),
      redirect: '/home',
      children: [
        // 首页
        {
          path: '/home',
          component: () => import('@/views/home/index.vue'),
        },
        // 展示页
        {
          path: '/show',
          component: () => import('@/views/show/index.vue'),
        },
        // 瀑布流
        {
          path: '/waterfall:id',
          component: () => import('@/views/waterfall/index.vue'),
        },
        // 文章详情
        {
          path: '/article-details:id',
          component: () => import('@/views/article-details/index.vue'),
        },
        // 时间轴
        {
          path: '/project',
          component: () => import('@/views/project/index.vue'),
        },
      ],
    },
  ],
})

export default router
